<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<!--view视图-->
<div id="app">

    <button v-on:click="sayHi">点</button>

</div>


<!--1.导入vue.js-->
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    var vm= new Vue({
        el: "#app",
        data: {
            message: "666"
        },
        methods: { //方法必须定义在vue的methods对象中
            sayHi: function (){
                alert(this.message);
            }
        }
    });
</script>
</body>
</html>